<%@page import="com.wanmait.cookbook.vo.Cookbook"%>

<%@page import="java.util.List"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"

	pageEncoding="UTF-8"%>

<%String path=request.getContextPath(); %>

<!DOCTYPE html>

<!-- saved from url=(0035)https://www.douguo.com/draft/recipe -->

<html lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">





<title>我的草稿箱_领先的中文美食菜谱分享,交流社区-豆果美食</title>

<link rel="icon"

	href="https://cp1.douguo.com/static/nweb/images/favicon.ico?v=1912"

	type="image/x-icon">

<link rel="stylesheet" href="<%=path%>/static/css/main.css">

<link rel="stylesheet" href="<%=path%>/static/css/person.css">

<script src="<%=path%>/static/js/hm.js.下载"></script>

<script src="<%=path%>/static/js/jquery.js.下载"></script>

<script data-ad-client="ca-pub-6608973961595981" async=""

	src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

<script>

    var _hmt = _hmt || [];

    (function() {

      var hm = document.createElement("script");

      hm.src = "https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f";

      var s = document.getElementsByTagName("script")[0];

      s.parentNode.insertBefore(hm, s);

    })();

    </script>

<style>

.one-pan-tip {

	cursor: pointer;

}



.one-pan-tip::before {

	background-position: center;

	background-size: 100% 100%;

	background-repeat: no-repeat;

	box-sizing: border-box;

	width: 1em;

	height: 1em;

	margin: 0 1px .15em 1px;

	vertical-align: middle;

	display: inline-block;

}



.one-pan-tip-success::before {

	content: '';

	background-image:

		url()

}



.one-pan-tip-error {

	text-decoration: line-through;

}



.one-pan-tip-error::before {

	content: '';

	background-image:

		url()

}



.one-pan-tip-other::before {

	content: '';

	background-image:

		url()

}



.one-pan-tip-lock::before {

	content: '';

	background-image:

		url()

}

</style>

<meta name="ljjc::status" content="on">

<% List<Cookbook> draftCookbook = (List<Cookbook>)request.getAttribute("draftCookbook"); %>

</head>

<body>

	<jsp:include page="/inc/head.jsp"></jsp:include>

	<script>

    //var time=Date.parse(new Date());

    $.ajax({

        url: "/login/user?time="+new Date().getTime(),

        data:"",

        success:function(res) {

            var headhtml="";

            if(res.data.user.user_id){//登录

                var user=res.data.user;

                // 发布弹窗

                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a>';

                if(user.is_create_article){

                    headhtml+='<a href="/uparticle.html">发布长笔记</a>';

                }

                if(user.is_create_video){

                    headhtml+='<a href="/video/upvideo">发布视频</a>';

                }

                headhtml+="  </div> </div>";

                //头像

                headhtml+='<div class="myinfo relative" onmouseover="javascript:$(\'.myedit\').show();" onmouseout="javascript:$(\'.myedit\').hide();"> <a class="headicon" href="/u/'+user.username+'.html"> <img class="wb100 br50" src="'+user.headicon+'" alt=""> <span class="msgnum"></span> </a> <div class="myedit br8"> <span class="arwwj"> </span> <a class="relative" href="/message/remind/1" target="_blank">消息提醒 <span class="boll"></span> </a> <a href="/u/'+user.username+'/collect">我的收藏</a> <a href="/draft/recipe">草稿箱</a> <a href="/user/profile" target="_blank">账号设置</a> <a href="/logout?v=1540878216">退出</a> </div> </div>';

            }else{//未登录

                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a> </div> </div> <div class="perinfo"> <a class="login" href="/login"> 登录 </a> | <a class="register" href="/signup.html" target="_blank"> 注册 </a></div>';

            }

            $("#header .header").append(headhtml);

        }

    });

</script>

	<div id="content" class="clearfix">

		<div id="left">

			<div class="type-tab">

				<div class="type-head clearfix">

					<a href="https://www.douguo.com/draft/recipe" class="active"

						one-link-mark="yes">菜谱</a>

				</div>

			</div>

			<ul class="draft-list mh600">


				<%

					for(Cookbook cookbook:draftCookbook){

				%>

				<li class="item">

					<div class="draft">

						<div class="draft-info">

							<a class="draft-title"

								href="<%=path %>/CookbookServlet?action=showDraftDetails&cookbookId=<%=cookbook.getId() %>"

								target="_blank" one-link-mark="yes"><%=cookbook.getTitle() %></a>

							<div class="draft-btn">

								<a class="edit-btn"

									href="<%=path %>/CookbookServlet?action=showDraftDetails&cookbookId=<%=cookbook.getId() %>"

									target="_blank" one-link-mark="yes">编辑</a>
									 <a class="del-btn"

									href="javascript:void(0)" COK="<%=cookbook.getId() %>" one-link-mark="yes">删除</a>

							</div>

							<span style="width:200" class="createtime"><%=cookbook.getInputTime() %></span>

						</div>

						<a class="draft-image"

							href="<%=path %>/CookbookServlet?action=showDraftDetails&cookbookId=<%=cookbook.getId() %>"

							style="background: url( <%=path%>/static/image/<%=cookbook.getPic() %> ) no-repeat center center; background-size: cover;"

							target="_blank" one-link-mark="yes"></a>

					</div>

				</li>

				<%

					}

				%>

				

			</ul>



			<p class="fcc">

				你当前的位置：<a href="https://www.douguo.com/" target="_blank"

					one-link-mark="yes">豆果美食</a> &gt; <a

					href="https://www.douguo.com/draft/recipe" target="_blank"

					one-link-mark="yes">个人中心</a> &gt; 草稿箱

			</p>

		</div>

	</div>

		

		 <jsp:include page="/inc/foot.jsp"></jsp:include>

	<script src="<%=path%>/static/js/tip.js.下载"></script>

	<script src="<%=path%>/static/js/search.js.下载"></script>

	<script src="<%=path%>/static/js/main.js.下载"></script>

	<!-- <script src='https://s13.cnzz.com/c.php?id=30029854' language='JavaScript' charset='gb2312'></script> -->



	<script type="text/javascript">

	$(function(){
		$(".del-btn").click(function(){
			if(!confirm("确定要删除吗？")){
				return false;
			}
			var th=$(this);
			$.ajax({
				url:"<%=path%>/CookbookServlet",
				data:{action:"draftBoxRemoveCookbook",cookBookId:$(this).attr("COK")},
				success:function(){
					th.parent().parent().parent().parent().remove();
				}
			});
		})
	});

</script>

</body>

</html>